<template>
  <div>
    <el-row :gutter="10" class="mb8">
      <right-toolbar :showSearch="false" :search="false" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-row :gutter="24">
      <el-col :xl="6" :lg="8" :md="8" :sm="8" :xs="12" v-for="item in dataList" :key="item.id"
        style="margin-bottom: 16px">
        <tank-item :info="item" :key="item.id" @on-success="getList"></tank-item>
      </el-col>
    </el-row>

  </div>
</template>

<script>
  import tankItem from './components/tankItem.vue'
  import {
    tanks
  } from "@/api/fleet";
  export default {
    name: "Tank",
    components: {
      tankItem
    },
    data() {
      return {
        // 按钮loading
        buttonLoading: false,
        // 遮罩层
        loading: true,
        // 显示搜索条件
        showSearch: false,
        // 总条数
        total: 0,
        // 油枪信息表格数据
        dataList: [],
        stationList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          stationId: undefined,
        },
        // 表单参数
        form: {

        },
        // 表单校验
        rules: {

        }
      };
    },
    async created() {
      this.getList();
    },
    methods: {

      /** 查询油罐信息列表 */
      getList() {
        this.loading = true;
        tanks(this.queryParams).then(response => {
          this.dataList = response.data;
          //this.total = Number(response.data.total);
          this.loading = false;
        });
      },
      // 表单重置
      reset() {
        this.form = {

        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },

    }
  };
</script>
